<html xmlns:th="http://www.thymeleaf.org">

<html>
  <head>
    <base href="<%=basePath%>">
	  <meta charset="UTF-8">
    <title>修改任务信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	  <link href="../../../../static/easyui/themes/insdep/easyui.css" rel="stylesheet" type="text/css">
	  <link href="../../../../static/easyui/themes/insdep/easyui_animation.css" rel="stylesheet" type="text/css">
	  <link href="../../../../static/easyui/themes/insdep/easyui_plus.css" rel="stylesheet" type="text/css">
	  <link href="../../../../static/easyui/themes/insdep/insdep_theme_default.css" rel="stylesheet" type="text/css">
	  <link href="../../../../static/easyui/themes/insdep/icon.css" rel="stylesheet" type="text/css">
	  <link href="../../../../static/easyui/themes/color.css" rel="stylesheet" type="text/css">

	  <link href="../../../../static/ztree/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" >
	  <link href="../../../../static/css/common.css" rel="stylesheet" type="text/css" >

	  <script type="text/javascript" src="../../../../static/jquery/jquery.min.js"></script>
	  <script type="text/javascript" src="../../../../static/easyui/jquery.easyui.min.js"></script>
	  <script type="text/javascript" src="../../../../static/easyui/themes/insdep/jquery.insdep-extend.min.js"></script>
	  <script type="text/javascript" src="../../../../static/ztree/jquery.ztree.all.min.js"></script>
	  <script type="text/javascript" src="../../../../static/easyui/easyui-lang-zh_CN.js"></script>
	  <script type="text/javascript" src="../../../../static/kindeditor/kindeditor-all-min.js"></script>

  </head>
  
 
   <body style="width:100%;max-width:600px;padding:30px 60px;">
  	<section class="info-section">
    	<form id="form" method="post">
    		<table>
				<tr>
					<td class="text-title">创建者名：</td>
					<td class="text-content">
						<select  class="myselect" name="creatorUserId" style="height: 35px">
							<option value="-1">请选择创建者</option>
							<option th:each="tbSystemUserss:${tbSystemUsers}" th:selected="${tbSystemUserss.id==tbCrmTask.creatorUserId?true:false}" th:value="${tbSystemUserss.id}" th:text="${tbSystemUserss.username}"></option>
						</select>
					</td>
				</tr>

				<tr>
					<td class="text-title">负责人：</td>
					<td class="text-content">
						<select  class="myselect" name="creatorUserId" style="height: 35px">
							<option value="-1">请选择创建者</option>
							<option th:each="systemUsers:${tbSystemUsers}" th:selected="${systemUsers.id==tbCrmTask.ownerUserId?true:false}" th:value="${systemUsers.id}" th:text="${systemUsers.username}"></option>
						</select>
					</td>
				</tr>
				<!--<tr style="display:${empty taskVo ? 'table-row' : 'none'};">
					<td class="text-title">删除人：</td>
					<td class="text-content">
						<input type="text" name="taskVo.DeleteUsername" value="${taskVo.deleteUsername }"
							class="easyui-textbox theme-textbox-radius" data-options="required:true,validType:'length[2,10]'">
					</td>
				</tr>-->

				<tr>
					<td class="text-title">相关人：</td>
					<td class="text-content">
						<input type="text" name="aboutUsers" th:value="${tbCrmTask.aboutUsers}"
							class="easyui-textbox theme-textbox-radius" data-options="required:true">
					</td>
				</tr>
				<tr>
					<td class="text-title">主题：</td>
					<td class="text-content">
						<input type="text" name="subject" th:value="${tbCrmTask.subject}"
							class="easyui-textbox theme-textbox-radius" data-options="required:true"></td>
				</tr>
				<tr>
					<td class="text-title">优先级：</td>
					<td class="text-content">
						<select  class="myselect" name="priority" style="height: 35px">
							<option th:value="-1">请选择优先级</option>
							<option th:selected="${tbCrmTask.priority==0?true:false}" th:value="0">低</option>
							<option th:selected="${tbCrmTask.priority==1?true:false}" th:value="1">普通</option>
							<option th:selected="${tbCrmTask.priority==2?true:false}" th:value="2">高</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="text-title">邮件通知：</td>
					<td class="text-content">
						<input type="text" name="sendEmail" th:value="${tbCrmTask.sendEmail}"
							class="easyui-textbox theme-textbox-radius" data-options="validType:'email'"></td>
				</tr>
				
				<tr>
					<td class="text-title">截止日期：</td>
					<td class="text-content">
						<input type="text" name="dueDate" th:value="${tbCrmTask.dueDate}"
							class="easyui-textbox theme-textbox-radius" data-options="required:true">
					</td>
				</tr>
				<tr>
					<td class="text-title"  style="height: 35px">更新日期：</td>
					<td class="text-content">
						<span style="height: 35px" th:text="${tbCrmTask.updateTime}"></span>
						<!--<input type="text" name="updateDate" th:value="${tbCrmTask.updateDate}"
							class="easyui-textbox theme-textbox-radius" disabled =“disabled”>-->
					</td>
				</tr>
				
				<tr>
					<td class="text-title">任务状态：</td>
					<td class="text-content">
						<select name="status" class="easyui-combobox theme-textbox-radius">
							<option value="not_start" th:selected="${tbCrmTask.status eq 'not_start'?true:false}" >未启动</option>
							<option value="delay" th:selected="${tbCrmTask.status eq 'delay'?true:false}" >推迟</option>
							<option value="running" th:selected="${tbCrmTask.status eq 'running'?true:false}">进行中</option>
							<option value="finished" th:selected="${tbCrmTask.status eq 'finished'?true:false}">已完成</option>
							<option value="closed" th:selected="${tbCrmTask.status eq 'closed'?true:false}">关闭的</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="text-title">描述信息：</td>
					<td class="text-content">
						<textarea class="theme-textbox-radius" rows="5"  cols="20" name="description" th:value="${tbCrmTask.description}"></textarea></td>
				</tr>
				<!-- 因为用户关联信息不需要修改，但是如果没有把这些信息传递给服务器端，hibernate对数据进行更新时就会把对应条目设置为null值 -->

				<tr style="display: none;">
					<td colspan="2">
						<input type="hidden" name="id" th:value="${tbCrmTask.id}"/>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: center;margin-top: 10px;">
						<a href="javascript:void(0);" id="saveBtn" class="easyui-linkbutton button-primary">保存</a> 
						<a href="javascript:void(0);" id="resetBtn" class="easyui-linkbutton button-danger">重置</a>
					</td>
				</tr>
			</table>	
    	</form>
    </section>
    </body>
    <script type="text/javascript">
    $(function(){
  			$("#resetBtn").on("click",function(){
  				$("#form").form("reset")
  			});
  		  		$("#saveBtn").on("click" , function(){
  		  		
  				$("#form").form("submit",{
  					url : "/manage/task/TaskAction_Update.action",
  					onSubmit : function(){
  					return $("#form").form("validate");
  					},
  					
  					success:function(data){
  						var obj=eval("("+ data +")")
						if(obj.success==true){
							$.messager.alert("提示",obj.msg,"info",function (){
								parent.closeTopWindow();
							});
						}else{
							$.messager.alert("警告",obj.msg,"info");
						}
  				}	
  				});
  			})
  		  		
  		})
  		</script>
</html>
